<!-- 日统计表 -->
<template>
  <div class="daily-table">
    <!-- 查询 -->
    <el-row :gutter="15">
      <el-col :span="20">
        <el-form label-width="80px" size="mini" :inline="true" class="demo-form-inline">
          <el-form-item label="客户">
            <el-input></el-input>
          </el-form-item>
          <el-form-item label="船代公司">
            <el-input></el-input>
          </el-form-item>
          <el-form-item>
            <el-select placeholder="请选择">
              <el-option>
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-date-picker
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="状态">
            <el-select placeholder="请选择">
              <el-option>
              </el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="4">
        <el-button type="primary" size="mini">搜索</el-button>
        <el-button size="mini">清空</el-button>
      </el-col>
    </el-row>
    <!-- 操作 -->
    <el-row>
      <el-form size="mini" :inline="true" class="demo-form-inline">
        <el-form-item>
          <el-button type="warning" size="mini">打印</el-button>
          <el-button size="mini">导出</el-button>
        </el-form-item>
      </el-form>
    </el-row>
    <!-- 表格 -->
    <div class="my-table">
      <div class="table-title">
        <div class="row">
          <div class="col">日期</div>
        </div>
        <div class="row">
          <div class="col">打单费</div>
        </div>
        <div class="row">
          <div class="col">服务费</div>
        </div>
        <div class="row">
          <div class="col">应收总计</div>
        </div>
        <div class="row">
          <div class="col">成本总计</div>
        </div>
      </div>
      <div class="table-content">
        <div class="row">
          <div class="col" :style="{width: 100/monthDays + '%'}" v-for="(item, index) in monthDays" :key="index">{{item}}</div>
        </div>
        <div class="row" v-for="(item, index) in 4" :key="index">
          <div class="col" :style="{width: 100/monthDays + '%'}" v-for="(item2, index) in 30" :key="index">
            {{0}}
          </div>
        </div>
      </div>
      <div class="table-right">
        <div class="row">
          <div class="col">合计</div>
        </div>
        <div class="row">
          <div class="col">0</div>
        </div>
        <div class="row">
          <div class="col">0</div>
        </div>
        <div class="row">
          <div class="col">0</div>
        </div>
        <div class="row">
          <div class="col">0</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      monthDays: 0
    }
  },
  mounted () {
    const d = new Date()
    this.monthDays = new Date(d.getFullYear(), (d.getMonth() + 1), 0).getDate()
  }
}
</script>

<style lang="less">
  .my-table{
    *{
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }
    font-size: 14px;
    border: 1px solid #ebeef5;
    position: relative;
    .col{
      display: inline-block;
      padding: 5px;
    }
    .row{
      width: 100%;
      display: inline-block;
    }
    .row + .row{
      border-top: 1px solid #ebeef5;
    }
    .table-title{
      width: 80px;
      border-right: 1px solid #ebeef5;
      font-weight: bolder;
    }
    .table-content{
      text-align: center;
      position: absolute;
      top: 0;
      left: 80px;
      right: 80px;
      bottom: 0;
      .col{
        border-right: 1px solid #ebeef5;
      }
    }
    .table-right{
      text-align: center;
      width: 80px;
      position: absolute;
      right: 0;
      top: 0;
      bottom: 0;
    }
  }
</style>
